import request from "../utils/request";

// /mall-api/cart/getCartList
// 获取购物车列表
export const findCartList = () => {
    return request('/mall-api/cart/getCartList')
}

// /mall-api/cart/checkCart/{goodsId}/{isChecked}
// 选中与取消选中购物车商品

export const changeChecked = (goodsId, isChecked) => {
    return request (`/mall-api/cart/checkCart/${goodsId}/${isChecked}`)
}

/*
 * /mall-api/cart/addToCart/{goodsId}/{count}
 * 添加商品至购物车 || 修改购物车数量
 * goodsId:商品id
 * count:差值  新旧商品数量的插值
 * blessing:祝福语 可选
 * 
 */
export const addToCart = (params) => {
    return request (`/mall-api/cart/addToCart/${params.goodsId}/${params.count}`,params)
}

/*****
 * /mall-api/cart/delete/{goodsId}
 * 删除购物车商品
 * goodsId:商品id
 * 
 */
export const delShop = (goodsId) => {
    return request (`/mall-api/cart/delete/${goodsId}`,)
}